package com.itheima.service;

import com.github.pagehelper.PageInfo;
import com.itheima.entity.QueryPageBean;
import com.itheima.pojo.Menu;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface MenuService {

    List<Menu> findAll();

    Menu selectMenuByIdWithoutChildren(int id);

    List<Menu> findAllBaseUserNameWithChildren(String  username);




    List<Menu> findAllBaseUserNameWithoutChildren(String  username);

    PageInfo<Menu> findAllWithoutChildrenByPage(QueryPageBean  queryPageBean);

    List<Menu> queryChildren(int menuId);

    PageInfo queryByKeyWord(QueryPageBean queryPageBean);




    int selectLevel1MenuId();

    List<Menu> findMenuByLevel(int level);

    @Transactional
    void deleteByMenuIdCascade(int id);

    @Transactional
    void deleteByMenuIdSafe(int id);

    @Transactional
    void createMenu(Menu menu);

    @Transactional
    void updateMenu(Menu menu);

}
